package com.rainman.noswagger.def_interface;

import com.rainman.noswagger.core.MethodTagWorkerInterface;
import com.rainman.noswagger.info_bean.MethodInfoBean;
import com.rainman.noswagger.info_bean.ErrBackInfoBean;

public class MethodTagEBackWorker implements MethodTagWorkerInterface<ErrBackInfoBean> {
    @Override
    public ErrBackInfoBean dealTag(MethodInfoBean methodInfoBean, String info, String lineComment) {

        String[] s = info.trim().split(" ");

        ErrBackInfoBean errBackInfoBean=new ErrBackInfoBean();

        if(s.length>0){
            errBackInfoBean.setErrCode(s[0]);
        }

        if(s.length>1){
            errBackInfoBean.setErrMsg(s[1]);
        }
        methodInfoBean.getReturnErrBeanList().add(errBackInfoBean);

        return errBackInfoBean;
    }

    @Override
    public String tagName() {
        return "@eback";
    }


}
